home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / programm.ing / ams__l~1.zoo / man / doublebu.man < prev    next >
Encoding:
Text File  |  1993-09-05  |  2.8 KB  |  90 lines

  1.                         ATARI MACHINE SPECIFIC LIBRARY
  2.  
  3.  
  4.  
  5. NAME
  6.      DoubleBuffer - encapsulated double buffering support
  7.  
  8. SYNOPSIS
  9.      #include <DoubleBuffer.h>
  10.  
  11.      class DoubleBuffer
  12.  
  13.      DoubleBuffer* Pages
  14.  
  15. DESCRIPTION
  16.      A commonly used technique for providing smoothe graphics is to use
  17.      two (or sometimes more) graphics screens.  While displaying one screen,
  18.      the programmer writes on the other, then waits until the vertical
  19.      retrace (the time when the physical screen is not being modified)
  20.      then flips them - displaying the newly written screen while writing
  21.      on the old one.
  22.  
  23. VARIABLES
  24.      BoubleBuffer* Pages
  25.         All graphics in the Atari Machine Specific Library draws on the
  26.       screens defined by this variable.  Initially, it simply represents
  27.       the standard desktop screen, but a programmer will usually set
  28.       it to point to a new DoubleBuffer representing a more useful pair
  29.       of screens.
  30.  
  31. CLASSES
  32.      DoubleBuffer encapsulates the double buffering concept.
  33.  
  34. CLASS MEMBERS
  35.   DoubleBuffer::
  36.      DoubleBuffer()         - A double buffer with two screens in the
  37.                               current resolution.
  38.      DoubleBuffer(Screen&,Screen&) - A specific pair of screens.
  39.  
  40.      void Flip()          - Swap pages.
  41.      void Flop()          - Swap pages unsynced (rarely useful).
  42.  
  43.      The following methods are mainly for internal AMS Library usage,
  44.      but are available for the programmer to add extensions.
  45.  
  46.      char  *Location()    - Location of image area to draw on.
  47.  
  48.      Screen& NowShowing() - Actual screen being displayed.
  49.      Screen& Current()    - Actual screen to draw on.
  50.  
  51.      short Pulse          - A value that changes from 0 to 1 according
  52.                              to the current displayed screen.
  53.  
  54. USAGE
  55.      For smooth display, the program should never draw on the currently
  56.      showing screen.
  57.  
  58.      Generally, the start of a program will set the value of Pages to
  59.      a new pair of screens, then the main animation loop will look
  60.      like this:
  61.  
  62.             while (...) {
  63.                 Wipe old graphics
  64.                 Draw new graphics
  65.                 Pages->Flip();
  66.             }
  67.  
  68. SEE ALSO
  69.      Screen, Sprite, FastCounter, BlockMap
  70.  
  71. BUGS
  72.      We should probably support more than 2-screen double buffering.
  73.      This extension could be easily added, but since we have never
  74.      really found a use for it, we haven't bothered.
  75.  
  76. AUTHOR
  77.      Warwick Allison, 1992.
  78.      warwick@cs.uq.oz.au
  79.  
  80. COPYING
  81.      This functionality is part of the Atari Machine Specific Library,
  82.      and is Copyright 1992 by Warwick W. Allison.
  83.  
  84.      The Atari Machine Specific Library is free and protected under the
  85.      GNU Library General Public License.
  86.  
  87.      You are free to copy and modify these sources, provided you acknowledge
  88.      the origin by retaining this notice, and adhere to the conditions
  89.      described in the GNU LGPL.
  90.